﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using BulldogCMS.Core.Runtime.Modules;
using BulldogCMS.Core.Storage;

namespace BulldogCMS.Manager.Controllers
{
    public class ContentController : BaseModuleController
    {
        //
        // GET: /Content/

        public ActionResult Index(string path)
        {
            if (path == null) path = "/Content";

            Node selectedNode = BulldogCMS.Core.Context.Application.Tree.GetNode(path);
            var child = selectedNode.Nodes.FirstOrDefault();
            if (selectedNode != null)
            {
                ViewBag.SelectedNode = selectedNode;
                return base.ModuleView("Content.Index");
            }
            else
            {
                return base.ModuleView("Content.Index");
            }
        }




    }
}
